$(function() {
			// $.ajax({
				// type: "get",
				// url: "http://192.168.8.123:8080/jeecg/wecharReportController.do?queryTransitData3",
				// dataType: "json",
				// async: true,
				// success: function(data) {
					// console.info(data);
	var data = $.parseJSON('{"message":"true","SUCCESS":"true","queryData":[{"SUMID":751164,"NHID":746268,"SUMDD":369561,"JCII":833,"YEAR":"2014","JCDI":26615,"NHDI":702201,"JCID":4896,"NHDD":361475,"SUMII":442991,"NHII":442158,"JCDD":8086,"SUMDI":728816},{"SUMID":987173,"NHID":981620,"SUMDD":457350,"JCII":1110,"YEAR":"2015","JCDI":39373,"NHDI":952602,"JCID":5553,"NHDD":448208,"SUMII":490456,"NHII":489346,"JCDD":9142,"SUMDI":991975},{"SUMID":1143348,"NHID":1031113,"SUMDD":420258,"JCII":115065,"YEAR":"2016","JCDI":133806,"NHDI":1006018,"JCID":112235,"NHDD":348600,"SUMII":749973,"NHII":634908,"JCDD":71658,"SUMDI":1139824}]}');
	if(data.SUCCESS) {
        data = data.queryData;
        for(var i = 0; i < data.length; i++) {
            $("body").append('<div id="chart0' + i + '" class="chart" ></div>');
            $("body").append('<div id="chart1' + i + '" class="chart" ></div>');
            $("body").append('<div id="chart2' + i + '" class="chart" ></div>');
            $('#chart0' + i).highcharts({
                chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false
                },
                title: {
                    text: data[i].YEAR + '年机场中转数占比'
                },
                credits: {
                    enabled: false
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        dataLabels: {
                            enabled: true,
                            format: ' {point.y}',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'white'
                            },
                            distance: -30
                        },
                        showInLegend: true
                    }
                },
                series: [{
                    type: 'pie',
                    name: '机场中转旅客总占比',
                    data: [
                        ['国内~国内', Number(data[i].JCDD)],
                        ['国内~国际', Number(data[i].JCDI)],
                        ['国际~国内', Number(data[i].JCID)],
                        ['国际~国际', Number(data[i].JCII)]
                    ]

                }]
            });
            $('#chart1' + i).highcharts({
                chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false
                },
                title: {
                    text: data[i].YEAR + '年南航中转数占比'
                },
                credits: {
                    enabled: false
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        dataLabels: {
                            enabled: true,
                            format: '{point.y}',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'white'
                            },
                            distance: -30
                        },
                        showInLegend: true
                    }
                },
                series: [{
                    type: 'pie',
                    name: '南航中转旅客总占比',
                    data: [
                        ['国内~国内', Number(data[i].NHDD)],
                        ['国内~国际', Number(data[i].NHDI)],
                        ['国际~国内', Number(data[i].NHID)],
                        ['国际~国际', Number(data[i].NHII)]
                    ]
                }]
            });
            $('#chart2' + i).highcharts({
                chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false
                },
                title: {
                    text: data[i].YEAR + '年总中转数占比'
                },
                credits: {
                    enabled: false
                },
                tooltip: {
                    headerFormat: '{series.name}<br>',
                    pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        dataLabels: {
                            enabled: true,
                            format: ' {point.y}',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'white'
                            },
                            distance: -30
                        },
                        showInLegend: true
                    }
                },
                series: [{
                    type: 'pie',
                    name: '总中转数比例',
                    data: [
                        ['国内~国内', Number(data[i].SUMDD)],
                        ['国内~国际', Number(data[i].SUMDI)],
                        ['国际~国内', Number(data[i].SUMID)],
                        ['国际~国际', Number(data[i].SUMII)]
                    ]
                }]
            });
        }
    }
             // }
         // });

});